require "Common/define"
require "Logic/Config"
require "Common/functions"

RedDotsSevenDayProcessHandler = {};
local this = RedDotsSevenDayProcessHandler;

function RedDotsSevenDayProcessHandler.init()
    CloseEvent(Config.EventType.Fresh_SevenDay, this.update);
    ListenEvent(Config.EventType.Fresh_SevenDay, this.update);

    return this;
end

-- 七天登陆是否存在
function RedDotsSevenDayProcessHandler.getFlag()
    for i = 1, #logicMgr.ActiveManager.sevenDayInfotab do
        local singleAci = logicMgr.ActiveManager.sevenDayInfotab[i];
        if (singleAci.draw == 0) then
            return Config.RedDotsFlagState.Needful;
        end
    end
    return Config.RedDotsFlagState.None;
end

function RedDotsSevenDayProcessHandler.update()
    RedDotsManager.addBroadcast(Config.RedDotsType.Sevenday);
end